﻿/*=========================================================
	TASK 2:                                        {Arrays}
	Write a program that reads two arrays from the console 
    and compares them element by element.    
===========================================================*/

using System;

class CompareTwoArrays
{
    static void Main()
    {
        Console.WriteLine("Enter the length of the First array:");
        int firLength = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter the length of the Second array:");
        int secLength = int.Parse(Console.ReadLine());

        int[] firstArray = new int[firLength];
        int[] secondArray = new int[secLength];

        string areEquals="";

        Console.WriteLine();
        if (firLength == secLength)
        {
            for (int i = 0; i < firLength; i++)
            {
                Console.Write("FisrtArray[{0}] = ",i);
                firstArray[i]=int.Parse(Console.ReadLine());
            }
            Console.WriteLine();
            for (int i = 0; i < secLength; i++)
            {
                Console.Write("SecondArray[{0}] = ", i);
                secondArray[i] = int.Parse(Console.ReadLine());

                if (firstArray[i] != secondArray[i])
                {
                    areEquals = "not equal";
                }
                else
                {
                    areEquals = "equal";
                }
            }
            Console.WriteLine();
            Console.WriteLine("Arrays are  {0}!", areEquals);
        }
        else
        {
            Console.WriteLine("Arrays are not equals!");
        }
        
        Console.WriteLine();
    }
}

